<template>
  <el-form ref="dataForm" :rules="rules" :label-position="labelPosition" label-width="80px" :model="user">
    <el-form-item label="旧密码" prop="oldPassword">
      <el-input v-model="user.oldPassword" type="password" placeholder="请输入旧密码"/>
    </el-form-item>
    <el-form-item label="新密码" prop="newPassword">
      <el-input v-model="user.newPassword" type="password" placeholder="请输入新密码"/>
    </el-form-item>
    <el-form-item label="确认密码" prop="confirmPassword">
      <el-input v-model="user.confirmPassword" type="password" placeholder="请输入确认密码" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary">保存</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  data() {
    return {
      labelPosition: 'right',
      user: {
        oldPassword: undefined,
        newPassword: undefined,
        confirmPassword: undefined
      },
      rules: {
        oldPassword: [{ required: true, message: '旧密码必填', trigger: 'blur' }],
        newPassword: [{ required: true, message: '新密码必填', trigger: 'blur' }],
        confirmPassword: [{ required: true, message: '新密码必填', trigger: 'blur' }]
      }
    }
  }
}
</script>
